#！/user/bin/env python3
# _*_ coding:utf-8  _*_
import math

weight=80.5
height=1.75
bmi=weight/(height*2)
if bmi<18.5:
    print("过轻")
elif bmi<25:
    print("正常")
elif bmi<28:
    print("过重")
elif bmi<32:
    print("肥胖")
else:
    print("严重肥胖")

##########################
L=['Bart','Lisa','Adam']
for i in L:
    print('Hello,',i)
print('#################################################')
###################
n1=255
n2=1000
print(hex(n1))
print(hex(n2))
print('#################################################')
###############funcition()

import abstest
print(abstest.my_abs(-5))
x,y=abstest.move(100,100,60,math.pi/6)
print(x,y)
r=abstest.move(100,100,60,math.pi/6)
print(r)

ans=abstest.quadratic(1,3,-4)
print(ans)
print(abstest.fact(5))
print('#################################################')
##############################

L=['Mike','Mary','Bob','Sink','Jack']

print('L[0:3] =',L[0:3])
print('L[:3] =',L[:3])
print('L[1:3] =',L[1:3])
print('L[-2:] =',L[-2:])

R=list(range(100))
print('R[:10] =',R[:10])
print('R[-10:] =',R[-10:])
print('R[10:20] =',R[10:20])
print('R[:10:2] =',R[:10:2])
print('R[::5] =',R[::5])

###############################
L = []
for x in range(1,11):
    L.append(x*x)

for x in L:
    print(x)

L=['Hello','World',18,'Apple',None]
L2=[s.lower() for s in L if isinstance(s,str)]
print(L2)

print('#################################################')
##########################################################
def fib(max):
    n,a,b=0,0,1
    while n<max:
        print(b)
        a,b=b,a+b
        n=n+1
    return 'done'

fib(10)

def triangle(max):
    n=0
    L=[1]
    while n<max:
        n=n+1
        yield L
        L.append(0)
        L.insert(0,0)
        L=[L[i]+L[i+1] for i in range(len(L)-1)]

for line in triangle(15):
    print(line)